/******************************************************************************
 * * modem.h
 *
 * *(C) Copyright 2019 Asr International Ltd.
 * * All Rights Reserved
 * ******************************************************************************/
#ifndef _APP_ADAPTOR_INTERFACE_H_
#define _APP_ADAPTOR_INTERFACE_H_

#ifdef __cplusplus
extern "C" {
#endif /* __cpluscplus */

#ifdef LV_CONF_INCLUDE_SIMPLE
#include "lvgl.h"
#include "lv_watch_conf.h"
#else
#include "../../../lvgl/lvgl.h"
#include "../../../lv_watch_conf.h"
#endif

#if USE_LV_WATCH_APP_ADAPTOR != 0

enum
{
    WATCH_WEATHER_ID_SUNNY = 0,
    WATCH_WEATHER_ID_CLOUDY,
    WATCH_WEATHER_ID_LIGHT_RAIN,
    WATCH_WEATHER_ID_HEAVY_RAIN,
    WATCH_WEATHER_ID_LITTLE_SNOW,
    WATCH_WEATHER_ID_HEAVY_SNOW,
    WATCH_WEATHER_ID_FOG,
    WATCH_WEATHER_ID_HAZE,
    WATCH_WEATHER_ID_WINDY,           //风
    WATCH_WEATHER_ID_OVERCAST,        //阴
    WATCH_WEATHER_ID_THUNDER_SHOWER,  //雷阵雨
    WATCH_WEATHER_ID_SHOWER,          //阵雨
    WATCH_WEATHER_ID_SAND_STORM,      //沙尘暴
    WATCH_WEATHER_ID_SLEET,           //雨夹雪
    WATCH_WEATHER_ID_SMOG,            //雾霾
    WATCH_WEATHER_ID_SUNNY_NIGHT,     //晴天夜晚
    WATCH_WEATHER_ID_OTHERS = 99,
    WATCH_WEATHER_ID_NO_INFO = 255
};
typedef uint8_t watch_app_adp_weather_id_t;

typedef struct
{
    watch_app_adp_weather_id_t  weather_id;
    int8_t                     current_temperature;
    int8_t                     lowest_temperature;
    int8_t                     highest_temperature;
    uint8_t                    uv;
    uint16_t                   aqi;
    char                        *city;
} app_adaptor_weather_t;

enum {
    WATCH_PORTRAIT_ID_FATHER = 1,
    WATCH_PORTRAIT_ID_MOTHER,
    WATCH_PORTRAIT_ID_PATERNAL_GRADFATHER,
    WATCH_PORTRAIT_ID_PATERNAL_GRADMOTHER,
    WATCH_PORTRAIT_ID_MATERNAL_GRADFATHER,
    WATCH_PORTRAIT_ID_MATERNAL_GRADMOTHER,
    WATCH_PORTRAIT_ID_UNCLE,
    WATCH_PORTRAIT_ID_AUNT,
    WATCH_PORTRAIT_ID_BROTHER,
    WATCH_PORTRAIT_ID_SISTER,
    WATCH_PORTRAIT_ID_BOY = 21,
    WATCH_PORTRAIT_ID_GIRL = 22,
    WATCH_PORTRAIT_ID_FAMILY = 99,
    WATCH_PORTRAIT_ID_OTHERS = 100,
    WATCH_PORTRAIT_ID_NO_INFO = 255
};
typedef uint8_t watch_app_adp_portrait_id_t;

#define WATCH_CONTACTS_MAX_NAME_LEN    (60 + 1) /*equal to NV_CONTACTS_MAX_NAME_LEN*/
#define WATCH_CONTACTS_MAX_NUMBER_LEN  (20 + 1) /*equal to NV_CONTACTS_MAX_NUMBER_LEN*/
typedef struct {
    char contact_number[WATCH_CONTACTS_MAX_NUMBER_LEN];
    char contact_name[WATCH_CONTACTS_MAX_NAME_LEN]; /*English or Chinese depend on app's input*/
    uint8_t contact_type; /*0:administrator, 1:standby administrator, 2: others*/
    watch_app_adp_portrait_id_t portrait_id;
} app_adaptor_contact_t;

typedef struct
{
    hal_rtc_t date;
    uint32_t step;
    uint16_t kcal;
    float    km;
} app_adaptor_pedometer_record_t;

enum
{
    SLEEP_GOOD = 0,
    SLEEP_SECONDARY,
    SLEEP_BAD,
    SLEEP_TERRIBLE
};
typedef uint8_t watch_app_adp_sleep_t;

typedef struct
{
    uint8_t heartrate;
    uint8_t bloodoxygen;
    uint8_t sleep;
    uint8_t pressure;
}app_adaptor_health_info_t;

typedef struct
{
    uint8_t valid;                                                // 1: valid, 0: invalid
    uint8_t on_off;                                               // 1: alarm on, 0: alarm off
    uint8_t hour;                                                 // [0, 23]
    uint8_t min;                                                  // [0, 59]
    uint8_t repeat_bitmap;                                        /* Bit 7: 0 means alarm once, 1 means repeat alarm */
    /* Bit 0 ~ 6 are valid if bit 7 is 1 */
    /* Bit 0: Sunday, bit 1: Monday ... bit 6: Saturday */
} app_adaptor_alarm_t;

#define APP_ADAPTOR_VOICE_MSG_MAX_CHAT_MSG_NUM 50

enum {
    WATCH_VOICE_MSG_TYPE_TEXT = 0,
    WATCH_VOICE_MSG_TYPE_VOICE,
    WATCH_VOICE_MSG_TYPE_EXPRESSION,
    WATCH_VOICE_MSG_TYPE_PHOTO
};
typedef uint8_t watch_app_adp_voice_msg_type_t;

typedef struct
{
    uint16_t year;
    uint8_t month;
    uint8_t day;
    uint8_t hour;
    uint8_t min;
} app_adp_time_and_date_t;


typedef struct
{
    uint8_t index;      /*indicate which unread voice message is read*/
    uint8_t * file;     /*WATCH_VOICE_DATA_TYPE_BUFFER: data buffer, WATCH_VOICE_DATA_TYPE_FILE: file path string*/
    uint32_t voice_len;
} app_adaptor_voice_msg_voice_t;

typedef struct
{
    uint32_t data_size;
    uint8_t * data;     /*WATCH_VOICE_DATA_TYPE_BUFFER: data buffer, WATCH_VOICE_DATA_TYPE_FILE: file path string*/
} app_adaptor_voice_msg_img_t;

enum {
    WATCH_VOICE_MSG_FROM_UI = 0,
    WATCH_VOICE_MSG_FROM_OTHER_DEVICE,
};
typedef uint8_t watch_app_adp_voice_msg_direction_t;

enum {
    WATCH_VOICE_DATA_TYPE_BUFFER = 0,
    WATCH_VOICE_DATA_TYPE_FILE,
};
typedef uint8_t watch_app_adp_voice_msg_data_type_t;

typedef struct
{
    char * name;    /*only for message received in group chat*/
    watch_app_adp_voice_msg_direction_t direction;
    bool read_flag; /*true:read, false:unread*/
    app_adp_time_and_date_t time;
    watch_app_adp_voice_msg_type_t type;
    watch_app_adp_voice_msg_data_type_t data_type; /*WATCH_VOICE_DATA_TYPE_BUFFER: transfer data buffer,
                                                *WATCH_VOICE_DATA_TYPE_FILE: transfer file path*/
    union
    {
        char * text; /*WATCH_VOICE_DATA_TYPE_BUFFER: text string, WATCH_VOICE_DATA_TYPE_FILE: file path string*/
        app_adaptor_voice_msg_voice_t voice;
        app_adaptor_voice_msg_img_t img; /*for expression or photo*/
    } content;
} app_adaptor_voice_msg_info_t;

enum {
    WATCH_VOICE_MSG_INVALID_CHAT = 0,
    WATCH_VOICE_MSG_SINGLE_CHAT,
    WATCH_VOICE_MSG_FAMILY_GROUP_CHAT,
    WATCH_VOICE_MSG_FRIENDS_GROUP_CHAT
};
typedef uint8_t watch_app_adp_voice_msg_chat_type_t;

typedef struct
{
    watch_app_adp_voice_msg_chat_type_t chat_type;  /*chat type: watch_app_adp_voice_msg_chat_type_t*/
    char * name;
    char * number;      /*not NULL if chat_type is WATCH_VOICE_MSG_SINGLE_CHAT, otherwise NULL*/
} app_adaptor_voice_msg_chat_id_t;

typedef struct
{
    watch_app_adp_voice_msg_chat_type_t chat_type;  /*chat type: watch_app_adp_voice_msg_chat_type_t*/
    char * name;
    char * number;      /*not NULL if chat_type is WATCH_VOICE_MSG_SINGLE_CHAT, otherwise NULL*/
    uint8_t count; /*count of messages*/
    app_adaptor_voice_msg_info_t * msg;
} app_adaptor_voice_msg_t;

enum {
    WATCH_VOICE_MSG_RESULT_SUCCESS = 0,
    WATCH_VOICE_MSG_RESULT_FAILURE
};
typedef uint8_t watch_app_adp_voice_msg_result_t;

typedef struct {
    uint16_t mcc;
    uint16_t mnc;
    uint16_t tac;
    uint16_t euarfcn;
    uint32_t cellid;
    uint32_t rsrp;
    uint32_t rsrq;
} app_adp_lte_scell_info_t;

typedef struct {
    uint8_t  index;
    uint16_t euarfcn;
    uint32_t phycellid;
    uint32_t cellid;
    uint32_t rsrp;
    uint32_t rsrq;
} app_adp_lte_ncell_Info_t;

typedef struct {
    uint16_t mcc;
    uint16_t mnc;
    uint16_t lac;
    uint16_t arfcn;
    uint8_t  bsic;
    uint32_t cell_id;
    uint8_t  rxlev;
} app_adp_gsm_cell_info_t;

#define APP_ADP_MAX_LTE_NCELL_NUM   6
#define APP_ADP_MAX_GSM_NCELL_NUM   6

typedef struct
{
    app_adp_lte_scell_info_t  scell;
    uint8_t                   encell_num;
    app_adp_lte_ncell_Info_t  encell[APP_ADP_MAX_LTE_NCELL_NUM];
    uint8_t                   gncell_num;
    app_adp_gsm_cell_info_t   gncell[APP_ADP_MAX_GSM_NCELL_NUM];
} app_adp_lte_cells_t;

typedef struct
{
    app_adp_gsm_cell_info_t   scell;
    uint8_t                   gncell_num;
    app_adp_gsm_cell_info_t   gncell[APP_ADP_MAX_GSM_NCELL_NUM];
    uint8_t                   encell_num;
    app_adp_lte_ncell_Info_t  encell[APP_ADP_MAX_LTE_NCELL_NUM];
} app_adp_gsm_cells_t;

enum {
    GET_CELL_INFO_ONCE_MODE,                         /*app only get cell info one time*/
    ENTER_CELL_INFO_AUTO_REPORT_MODE_OPEN,           /*enter the cell info changed auto-report mode*/
    EXIT_CELL_INFO_AUTO_REPORT_MODE                  /*exit the cell info changed auto-report mode*/
};
typedef uint8_t watch_app_adp_get_cell_info_mode_t;

enum {
    APP_SMS_SEND_SUCCESS = 0,                        /*app send sms success*/
    APP_SMS_SEND_FAIL                                /*app send sms fail*/
};
typedef uint8_t watch_app_adp_sms_send_result_type_t;

enum {
    APP_SMS_CODE_TYPE_UTF_8,                         /*smspdu decode to utf-8 type*/
    APP_SMS_CODE_TYPE_UTF_16,                        /*smspdu decode to utf-16 type*/
    APP_SMS_CODE_TYPE_8_BIT                          /*smspdu decode to 8bit type*/
};
typedef uint8_t watch_app_adp_sms_code_type_t;

typedef struct
{
    char * number;
    uint8_t number_len;
    char * time;
    uint8_t time_len;
    char * data;
    uint16_t data_len;
} app_adp_new_sms_info_ind_t;

enum
{
    APP_PLMN_RAT_GSM = 0,                                                 // GSM network
    APP_PLMN_RAT_UMTS,                                                    // UTRAN network
    APP_PLMN_RAT_LTE,                                                     // LTE network
    APP_PLMN_RAT_UNKNOW
};

typedef uint8_t watch_app_plmn_rat_type_t;

typedef struct {
    char regMnc[4];   ///register Mnc 3 character
    char regMcc[4];
    char homeMnc[4];   ///home Mnc 3 characters
    char homeMcc[4];
    int  signalstrength;
    int  lac;
    int  cid;
#define  INVALID_INT_MAX 0x7FFFFFFF
    int  realdbm;        //INVALID_INT_MAX is invalid value
    watch_app_plmn_rat_type_t  rat;
} app_adp_reg_and_home_plmn_info_t;

/* wifi begin*/
#define APP_ADP_WIFI_MAC_LEN           6
#define APP_ADP_WIFI_AP_MAX_NUM        10

enum {
    APP_ADP_WIFI_RESULT_SUCCESS = 0,
    APP_ADP_WIFI_RESULT_FAILURE,
    APP_ADP_WIFI_RESULT_TIMEOUT,
};
typedef uint8_t app_adp_wifi_result_t;

typedef struct {
    uint8_t mac[APP_ADP_WIFI_MAC_LEN];
    int32_t rssi;
} app_adp_wifi_ap_item;

typedef struct {
    uint8_t count;
    app_adp_wifi_ap_item item[APP_ADP_WIFI_AP_MAX_NUM];
} app_adp_wifi_ap_list;
/* wifi end*/

enum {
    APP_ADP_MEDCR_POSITION_LTE  = 46,
    APP_ADP_MEDCR_POSITION_UMTS = 47,
    APP_ADP_MEDCR_POSITION_GSM  = 48,
};
typedef uint8_t app_adp_medcr_position_t;

/* message begin */
typedef struct
{
    uint8_t msg_source; /* message source, 0 : SMS; 1 : WeChat */
    uint32_t msg_index; /* message index, use for deleting message */
    char * name;        /* messager name or number */
    char * data;        /* message content */
} app_adaptor_new_message_info_t;

enum {
    APP_ADP_MSG_SOURCE_SMS = 0,
    APP_ADP_MSG_SOURCE_WECHAT,
};
typedef uint8_t app_adp_msg_source_t;
/* message end */

#define ACTIVITY_WDAY_CNT    7   //from Sunday to Saturday
#define ACTIVITY_OCLOCK_CNT 16   //from 7:00 to 22:00

typedef struct
{
    uint32_t steps_goal; //steps
    uint32_t steps_today;
    uint32_t steps_wday[ACTIVITY_WDAY_CNT];
    uint32_t high_strength_goal;   //mins
    uint32_t high_strength_today;
    uint32_t high_strength_wday[ACTIVITY_WDAY_CNT];
    uint32_t active_hours_goal;    //hours
    uint32_t active_hours_today;
    uint32_t active_hours_wday[ACTIVITY_WDAY_CNT];
    double calorie;  //kcal
    double distance; //km
    double stairs;   //m
    uint8_t active[ACTIVITY_OCLOCK_CNT];  //0 or 1
} app_adaptor_activity_info_t;

/**
 * get weather information
 * param (out) weather: app_adaptor_weather_t * 255 means no weather information
 * return  void
 */
void app_adaptor_get_weather_req(app_adaptor_weather_t *weather);

/**
 * update phonebook
 * param (in) contactlist: app_adaptor_contact_t *
 * param (in) count: uint8_t
 * return  void
*/
void app_adaptor_update_phonebook_ind(app_adaptor_contact_t *contactlist, uint8_t count);

/**
 * get model id of the wathc
 * param (in) void
 * return  char
*/
char *app_adaptor_get_model_id(void);

/**
 * get version of the software
 * param (in) void
 * return  char
*/
char *app_adaptor_get_version(void);

/**
 * get cid for generating qrcode
 * param (in) void
 * return  char
*/
char *app_adaptor_get_cid_for_qrcode(void);

/**
 * get cid for generating barcode
 * param (in) void
 * return  char
*/
char *app_adaptor_get_cid_for_barcode(void);

/**
 * send the sos information to app
 * param (out) void
 * return  void
 */
void app_adaptor_send_sos_info_req(void);

/**
 * update pedometer recent record
 * param (in) record: app_adaptor_pedometer_record_t *
 * return  void
 */
void app_adaptor_update_pedometer_record_ind(app_adaptor_pedometer_record_t* record);

/**
 * update pedometer current steps
 * param (in) record: app_adaptor_pedometer_record_t *
 * return  void
 */
void app_adaptor_get_pedometer_info_req(app_adaptor_pedometer_record_t * record);

/**
 * get health info
 * param (in) health: app_adaptor_health_info_t *
 * return  void
 */
void app_adaptor_get_health_info_req(app_adaptor_health_info_t * health);

/**
 * bind set monitor call back function
 * param (in) monitor: bool, true means on, false means off
 * return  void
 */
void app_adaptor_set_monitor(bool monitor);

/**
 * set alarm call back function
 * param (in) alarm: alarm_t *
 * param (in) count: uint8_t
 * return  void
 */
typedef void (*app_adaptor_set_alarm)(app_adaptor_alarm_t *alarm, uint8_t count);

/**
 * alarm ind back function
 * param (in) alarm: alarm_t *
 * param (in) count: uint8_t
 * return  void
 */
typedef void (*app_adaptor_alarm_ind)(app_adaptor_alarm_t *alarm, uint8_t count);

/**
 * bind set alarm call back function
 * param (in) func app_adaptor_set_alarm
 * return  void
 */
void app_adaptor_set_alarm_bind(app_adaptor_set_alarm func);

/**
 * bind alarm ind call back function
 * param (in) func app_adaptor_set_alarm
 * return  void
 */
void app_adaptor_alarm_ind_bind(app_adaptor_alarm_ind func);

/**
 * shutdown call back function
 * param (in) poweron_time: hal_rtc_t *
 * param (in) CallBack: AlarmCallback
 * return  void
 */
typedef void (*app_adaptor_shutdown)(hal_rtc_t *poweron_time);

/**
 * bind shutdown call back function
 * param (in) func app_adaptor_shutdown
 * return  void
 */
void app_adaptor_shutdown_bind(app_adaptor_shutdown func);

/**************for voice msg**************/
/**
 * receive a new message from other device
 * param (in) msg: app_adaptor_voice_msg_t *
 * return  void
 */
void app_adaptor_voice_msg_rcv_ind(app_adaptor_voice_msg_t * msg);

/**
 * send a new message from ui
 * param (in) msg: app_adaptor_voice_msg_t *
 * return  char *: file path string if voice data is written into file, otherwise NULL
 */
char * app_adaptor_voice_msg_send_req(app_adaptor_voice_msg_t * msg);

/**
 * result for sending the new message from ui
 * param (in) watch_app_adp_voice_msg_result_t
 * return  void
 */
void app_adaptor_voice_msg_send_cnf(watch_app_adp_voice_msg_result_t result);

/**
 * get all of the messages for the chat
 * param (in) id: app_adaptor_voice_msg_chat_id_t *
 * return  app_adaptor_voice_msg_t *
 */
app_adaptor_voice_msg_t * app_adaptor_voice_msg_get_msgs_req(app_adaptor_voice_msg_chat_id_t * id);

/**
 * inform that the unread voice message with index in the chat is read
 * param (in) id: app_adaptor_voice_msg_chat_id_t *
 * param (in) index: uint8_t, index in app_adaptor_voice_msg_voice_t
 * return  void
 */
void app_adaptor_voice_msg_read_voice_req(app_adaptor_voice_msg_chat_id_t * id, uint8_t index);

/**************for speech recog**************/
/**
 * network search from user for speech recog
 * param (in) voice_data: uint8_t *
 * param (in) voice_size: uint32_t
 * return  void
 */
void app_adaptor_speech_recog_nw_search_req(uint8_t * voice_data, uint32_t voice_size);

/**
 * return text through network search from user for speech recog
 * param (in) text: char *, network failed if txt is NULL
 * return  void
 */
void app_adaptor_speech_recog_nw_search_cnf(char * text);

/**
 * inform of text with voice from server for speech recog
 * param (in) text: char *
 * param (in) voice_data: uint8_t *
 * param (in) voice_size: uint32_t
 * return  void
 */
void app_adaptor_speech_recog_txt_msg_ind(char * text, uint8_t * voice_data, uint32_t voice_size);

/**
 * inform of text and index for audio from server for speech recog
 * param (in) audio_text: char *
 * param (in) audio_index: uint8_t, for playing the audio with index, to be confirmed
 * return  void
 */
void app_adaptor_speech_recog_audio_msg_ind(char * audio_text, uint8_t audio_index);

/**
 * request to play the audio with index from serverfor speech recog
 * param (in) audio_index: uint8_t, for playing the audio with index
 * return  void
 */
void app_adaptor_speech_recog_play_audio_req(uint8_t audio_index);

/**
 * start to play the audio
 * param (in) total_sec: uint16_t, total time for audio in seconds, not zero
 * return  void
 */
void app_adaptor_speech_recog_play_audio_cnf(uint16_t total_sec);

/**
 * request to stop the audio with index
 * param (in) audio_index: uint8_t, for stopping the audio with index
 * return  void
 */
void app_adaptor_speech_recog_stop_audio_req(uint8_t audio_index);

/**
 * playing time for audio
 * param (in) cur_sec: uint16_t, in seconds
 * return  void
 */
void app_adaptor_speech_recog_play_audio_ind(uint16_t cur_sec);

/**
 * get cell information request
 * param (in) watch_app_adp_get_cell_info_mode_t mode:refer to
 * the define of "watch_app_adp_get_cell_info_mode_t"
 * return  void
*/
void app_adaptor_get_cell_info_req(watch_app_adp_get_cell_info_mode_t mode);

/**
 * lte cell information indication call back function
 * param (in) cell_list: app_adp_lte_cells_t
 * return  void
 */
typedef void (*app_adaptor_lte_cell_info_ind)(app_adp_lte_cells_t *cell_list);

/**
 * bind lte cell information indication call back
 * param (in) func app_adaptor_shutdown
 * return  void
 */
void app_adaptor_lte_cell_info_ind_bind(app_adaptor_lte_cell_info_ind func);

/**
 * GSM cell information indication call back function
 * param (in) cell_list: app_adp_lte_cells_t
 * return  void
 */
typedef void (*app_adaptor_gsm_cell_info_ind)(app_adp_gsm_cells_t *cell_list);

/**
 * bind GSM cell information indication call back
 * param (in) func app_adaptor_lte_cell_info_ind
 * return  void
 */
void app_adaptor_gsm_cell_info_ind_bind(app_adaptor_gsm_cell_info_ind func);

/**
 * SMS send result call back function
 * param (in) cell_list: app_adp_lte_cells_t
 * return  void
 */
typedef void (*app_adaptor_sms_send_result_ind)(watch_app_adp_sms_send_result_type_t result);

/**
 * send a short message(data encode with utf-8) from app
 * param (in) number: char *
 *            data: char *
 *            datalen:uint32_t,the length without '\0'
 *            smsc_number: char *
 *            app_adaptor_sms_send_result_ind func:the call back for sms send result
 * return  uint8_t:1 is correct,0 is incorrect
*/
uint8_t app_adaptor_sms_send_req(char * number, char * data, uint32_t datalen, char * smsc_number, app_adaptor_sms_send_result_ind func);

/**
 * send a short message(data encode with utf-16) from app
 * param (in) number: char *
 *            data: char *
 *            datalen:uint32_t,the length without '\0'
 *            smsc_number: char *
 * return  uint8_t:1 is correct,0 is incorrect
*/
uint8_t app_adaptor_sms_send_with_utf16_req(char * number, char * data, uint32_t datalen, char * smsc_number, app_adaptor_sms_send_result_ind func);

/**
 * send a short message(data encode with 8 bit) from app
 * param (in) number: char *
 *            data: char *
 *            datalen:uint8_t,the length without '\0'
 *            smsc_number: char *
 *            app_adaptor_sms_send_result_ind func:the call back for sms send result
 * return  uint8_t:1 is correct,0 is incorrect
*/
uint8_t app_adaptor_sms_send_with_8bit_req(char * number, char * data, uint8_t datalen, char * smsc_number, app_adaptor_sms_send_result_ind func);

/**
* new sms information indication call back function
* param (in) sms_info: app_adp_new_sms_info_ind_t *
* return  void
*/
typedef void (*app_adaptor_new_sms_info_ind)(app_adp_new_sms_info_ind_t *sms_info);

/**
 * bind new sms information indication call back
 * param (in) func app_adaptor_new_sms_info_ind
 *            decode_type:APP_SMS_CODE_TYPE_UTF_8 or APP_SMS_CODE_TYPE_UTF_16
 * return  void
 */
void app_adaptor_new_sms_info_ind_bind(app_adaptor_new_sms_info_ind func, watch_app_adp_sms_code_type_t decode_type);

/**
 * bind new 8-bit sms information indication call back
 * param (in) func app_adaptor_new_sms_info_ind
 * return  void
 */
void app_adaptor_new_8bit_sms_info_ind_bind(app_adaptor_new_sms_info_ind func);

/**
 * get ICCID request
 * param (in) void:
 * return  char *ICCID:if null means no sim or ICCID not present
*/
char* app_adaptor_get_iccid_info_req(void);

/**
 * get Plmn request
 * param (in) void:
 * return  app_adp_reg_and_home_plmn_info_t* plmn:it contains register plmn and home plmn,
 * if plmn are 0,it means invaild.
*/
app_adp_reg_and_home_plmn_info_t* app_adaptor_get_plmn_info_req(void);

/**
 * get phone number request
 * param (in) void:
 * return  char * phonenumber:if null means no sim or phone number not present
*/
char* app_adaptor_get_msisdn_info_req(void);

/**
 * wifi scan call back function
 * param (in) result: app_adp_wifi_result_t
 * param (in) ap_list: app_adp_wifi_ap_list *
 * return  void
 */
typedef void (* app_adp_wifi_scan_cb)(app_adp_wifi_result_t result, app_adp_wifi_ap_list * ap_list);

/**
 * wifi scan request
 * param (in) scan_rounds: range 1-3, rounds of wifi scan
 * param (in) max_hotspot_number: range 4-10, maximum number of wifi hotspots reported
 * param (in) timeout_seconds: range 1-25, timeout value to scan wifi in seconds
 * param (in) priority: 0, data traffic has higher priority than wifi scan,
 *                         data traffic will interrupt the wifi scan;
 *                      1, data traffic has lower priority than wifi scan,
 *                         data traffic will be blocked during wifi scan
 * param (in) cb: wifi scan call back function
 * return  uint8_t
 */
uint8_t app_adaptor_wifi_scan(uint8_t scan_rounds,
                              uint8_t max_hotspot_number,
                              uint32_t timeout_seconds,
                              uint8_t priority,
                              app_adp_wifi_scan_cb cb);

/**
 * get sim status
 * param (in) void:
 * return bool: 0: sim not present; 1: sim present
*/
uint8_t app_adaptor_get_sim_status_req(void);

/*
 * set Neighbour Bch query option
 * param   option: 0/1
 * return  void
 */
void app_adaptor_set_ncell_bch_req(UINT8 option);

/**
 * radio power status call back function
 * param (in) status: uint8_t, 1(+CFUN:1), 4(+CFUN:4)
 * return  void
 */
typedef void (* app_adp_radio_power_cb)(uint8_t status);

/**
 * get radio power status(AT+CFUN?)
 * param (in) cb: app_adp_radio_power_cb
 * return void
 */
void app_adp_get_radio_power_status_req(app_adp_radio_power_cb cb);

/**
 * request radio power(AT+CFUN=1 or AT+CFUN=4)
 * param (in) onoff: uint8_t, 1(AT+CFUN=1), 0(AT+CFUN=4)
 * return void
 */
void app_adp_radio_power_req(uint8_t onoff);

/**
 * fast dormancy request
 * param (in) void:
 * return void
*/
void app_adaptor_fast_dormancy_req(void);

/**
 * drx pch request
 * param (in) position: app_adp_drx_pch_position_t
 * param (in) config_val: 1, 2, 4, 8, 16, 32
 * return void
*/
void app_adaptor_drx_pch_req(app_adp_medcr_position_t position, uint8_t config_val);

/**
 * enable/disable LTE fast dormancy
 * param (in) time_value: (unit: second), 0 for disable.
 * return void
*/
void app_adaptor_enable_lte_fast_dormancy_req(uint8_t time_value);

/**
 * get roaming status
 * param (in) void
 * return uint8_t: 0 not roaming, 1 roaming
*/
uint8_t app_adp_get_roaming_stat_req(void);

/**
 * get IMSI of sim
 * param (out)  imsi: char*
 * return  void
 */
void app_adp_get_imei_req(char * imei);

/**
 * get IMEI of watch
 * param (out) imei: char*
 * return  void
 */
void  app_adp_get_imsi_req(char * imsi);

/* message begin */
/**
* new message information
* param (in) msg_info: app_adaptor_new_message_info_t *
* return  void
*/
void app_adaptor_update_message_info_req(app_adaptor_new_message_info_t * msg_info);

/**
* delete message information since message deleted by user or message read by user
* param (in) index: uint32_t
* return  void
*/
void app_adaptor_delete_message_info_req(uint32_t index);
/* message end */

/**
 * get activity info
 * param (in) activity: app_adaptor_activity_info_t *
 * return  void
 */
void app_adaptor_get_activity_info_req(app_adaptor_activity_info_t * activity);

/**
 * qq new msg ind
 * param (in) msg_type: 0-new msg; 1-new friend
 * return  void
 */
void app_adaptor_qq_new_message_ind(uint8_t msg_type);

#endif /*USE_LV_WATCH_APP_ADAPTOR*/

#ifdef __cplusplus
}
#endif /* __cpluscplus */

#endif /* end of _APP_ADAPTOR_INTERFACE_H_ */
